package data.join.com.http;

import android.text.TextUtils;

import java.io.File;

import data.join.com.database.bean.VideoBean;
import data.join.com.utils.MyDate;

/**
 * Created by Administrator on 2016/5/6.
 */
public class VideoInfo {
    public long videoId;
    public String srcPath;
    public String thumbnail;
    public long duration;
    public String startTime;
    public int videoType;
    public int backOrFont;
    public long fileSize;
    public String date;
    public String timeDisplay;

    public VideoInfo(VideoBean bean){
        videoId = bean.id;
        srcPath = bean.srcPath;
        thumbnail = bean.thumbnail;
        duration = bean.duration;
        startTime = MyDate.getFormatTimeByLong(bean.startTime);
        videoType = bean.videoType;
        backOrFont = bean.backOrFont;
        if(!TextUtils.isEmpty(srcPath)) {
            fileSize = new File(srcPath).length();
        }else{
            fileSize = 0;
        }
        timeDisplay = MyDate.getFormatTimeByLong(bean.startTime);
        date = MyDate.getFormatDateByLong(bean.startTime);
    }
}
